Skip to main content

All Questions

Tagged with
0votes
1answer
836views

Only perform sed operations on lines starting with a particular string [closed]

I have the following file format Received from +11231231234 at 2021-10-10T19:56:50-07:00: This is a message that contains words like from, at, etc. Sent to +11231231234 at 2021-10-11T06:50:57+00:00: ...
jf4i2d's user avatar
3votes
1answer
4kviews

How do I use sed to insert a line at the top of my file?

I'm using bash shell on Amazon Linux. I'm trying to insert a line at the top of my file so I have header_line="first_line_of_file" ... sed -i "1 i\$header_line" /tmp/$file_title However what is ...
Dave's user avatar
  • 2,738
-1votes
2answers
739views

Extracting certain data within a script output file

We have a script that runs several commands and rolls up all the output and inserts in into a log file. One of the commands it runs is "netstat -anp". I'd like to be able to search this file for all ...
user53029's user avatar

close